<?php
if(isset($_GET['id'])) {
	$data = getDuAnByID($_GET['id']);
	if (count($data) > 0) {
		$ListCateDuAn = getTypeDuAns();
?>
<style>
.class-add-project tr { 
	background: #FFFFFF;
}

.class-add-project td {
	height: 30px;
}
</style>
<div>
	<div style="width: 100%; color:#588f27; text-transform:uppercase; font-weight: bold; text-align:center;"><h1 style="font-size: 16px;">Cập Nhật Dự Án</h1></div>
    <div class="class-add-project">
    	<form method="post" id="form_action_uptypepro" action="control/AdminDuAn.php">
        	<input type="hidden" name="idpro" value="<?php echo($data[0][0]) ?>" />
            <table bgcolor="#e0eaf1" cellspacing="1" cellpadding="0" border="0" width="100%">
            	<tr>
                    <td width="15%"><span style="margin:5px;"><strong>Loại Dự Án <font color="#FF0000">(*)</font></strong></span></td>
                    <td>
                    	<select class="typeduan" name="form_type" id="form_type" style="width: 300px; height: 30px; padding:5px; border: 1px solid #F90;">
                            <?php
                            foreach($ListCateDuAn as $entry) {
                            ?>
                            <option value="<?php echo($entry[0]); ?>" <?php if ($entry[0] == $data[0][1]) { echo(" selected='selected'"); } ?>><?php echo($entry[1]); ?></option>
                            <?php	
                            }
                            ?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td width="15%"><span style="margin:5px;"><strong>Title Dự Án <font color="#FF0000">(*)</font></strong></span></td>
                    <td><input name="form_title" id="form_title" type="text" style="width: 99%; height: 25px; padding:5px; border: 1px solid #F90;" placeholder="" maxlength="255" value="<?php echo($data[0][3]) ?>" /></td>
                </tr>
                <tr>
                    <td width="15%"><span style="margin:5px;"><strong>Tên Dự Án <font color="#FF0000">(*)</font></strong></span></td>
                    <td><input name="form_name" id="form_name" type="text" style="width: 99%; height: 25px; padding:5px; border: 1px solid #F90;" placeholder="" maxlength="255" value="<?php echo($data[0][5]) ?>" /></td>
                </tr>
                <tr>
                    <td width="15%"><span style="margin:5px;"><strong>Chủ Đầu Tư <font color="#FF0000">(*)</font></strong></span></td>
                    <td><input name="form_chu_dau_tu" id="form_chu_dau_tu" type="text" style="width: 99%; height: 25px; padding:5px; border: 1px solid #F90;" placeholder="" maxlength="255" value="<?php echo($data[0][6]) ?>" /></td>
                </tr>
                <tr>
                    <td width="15%"><span style="margin:5px;"><strong>Địa Chỉ <font color="#FF0000">(*)</font></strong></span></td>
                    <td><input name="form_address" id="form_address" type="text" style="width: 99%; height: 25px; padding:5px; border: 1px solid #F90;" placeholder="" maxlength="255" value="<?php echo($data[0][7]) ?>" /></td>
                </tr>
                <tr>
                    <td width="15%"><span style="margin:5px;"><strong>Diện Tích <font color="#FF0000">(*)</font></strong></span></td>
                    <td><input name="form_dien_tich" id="form_dien_tich" type="text" style="width: 99%; height: 25px; padding:5px; border: 1px solid #F90;" placeholder="" maxlength="255" value="<?php echo($data[0][8]) ?>" /></td>
                </tr>
                <tr>
                    <td width="15%"><span style="margin:5px;"><strong>Thiết Kế Thi Công <font color="#FF0000">(*)</font></strong></span></td>
                    <td><input name="form_tk_thi_cong" id="form_tk_thi_cong" type="text" style="width: 99%; height: 25px; padding:5px; border: 1px solid #F90;" placeholder="" maxlength="255" value="<?php echo($data[0][9]) ?>" /></td>
                </tr>
                <tr>
                    <td width="15%"><span style="margin:5px;"><strong>Nội Dung Tóm Tắt <font color="#FF0000">(*)</font></strong></span></td>
                    <td><input name="form_content_tt" id="form_content_tt" type="text" style="width: 99%; height: 25px; padding:5px; border: 1px solid #F90;" placeholder="" maxlength="255" value="<?php echo($data[0][10]) ?>" /></td>
                </tr>
                <tr>
                    <td width="15%"><span style="margin:5px;"><strong>Nội Dung <font color="#FF0000">(*)</font></strong></span></td>
                    <td><textarea name="form_content" class="tinymce" aria-hidden="true" style="width: 100%; height: 60px; border: 1px solid #F90;"><?php echo($data[0][11]) ?></textarea></td>
                </tr>
                <tr>
                    <td width="15%"><span style="margin:5px;"><strong>Tác Giả <font color="#FF0000">(*)</font></strong></span></td>
                    <td><input name="form_author" id="form_author" type="text" style="width: 99%; height: 25px; padding:5px; border: 1px solid #F90;" placeholder="" maxlength="255" value="<?php echo($data[0][12]) ?>" /></td>
                </tr>
                <tr>
                    <td width="15%"><span style="margin:5px;"><strong>Link Image <font color="#FF0000">(*)</font></strong></span></td>
                    <td>
                    	<input name="form_image" id="form_image" type="text" style="width: 99%; height: 25px; padding:5px; border: 1px solid #F90;" placeholder="" maxlength="255" value="<?php echo($data[0][4]) ?>" /><br /><br />
                        <?php
						if ($data[0][4] != "") {
						?>
                        <img width="300px" src="<?php echo($data[0][4]) ?>" />
                        <?php 
						}
						?>
                    </td>
                </tr>
                <tr>
                    <th colspan="2"><input type="hidden" name="act" value="edit" /><input type="submit" value="Cập Nhật" style="border-radius: 5px; padding:5px; width:100px; background:#588f27; color:#FFF; font-weight:bold; text-align:center;" /></th>
                </tr>
            </table>
    	</form>
    </div>
</div>
</style>

<?php

	}
}
?>